<template>
	<view class="page">
		<navbar backIconName="arrow-left" title="政策详情" :titleStyle="titleStyle"></navbar>
		<view :style="{height:statusHeight+'px'}"></view>
		<scroll-view class="scroll-view_H" :style="{height: 'calc(100vh - ' + (statusHeight)+'px)'}" scroll-y="true">
			<view class="news-info ql-editor">
				<view style="display: flex;flex-direction: column;">
					<text
						style="font-size: 36rpx;color: #323232;font-weight: bold;margin-bottom: 20rpx;">{{newsInfo.policyTitle || '-'}}</text>
					<text style="font-size: 26rpx;color: #666;margin-bottom: 20rpx;">{{newsInfo.publishTime || '-'}}</text>
				</view>
				<rich-text :nodes="newsInfo.content"></rich-text>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import config from '@/api/config'
	let App = getApp();
	export default {
		components: {},
		data() {
			return {
				statusHeight: 44 + App.globalData.statusBarHeight,
				titleStyle: {
					color: "#ffffff",
					fontWeight: "bold",
					fontSize: "18px"
				},
				title: "",
				richContent: "",
				releaseTime: "",
				columnId: "",
				newsInfo: null,
			};
		},
		onLoad(options) {
			this.columnId = options.columnId
			this.getNewsDetail(options.columnId)
		},
		methods: {
			getNewsDetail(id) {
				uni.request({
					url: config.baseUrlNews + '/business/content/rest/getById/' + id,
					method: 'GET',
					data: {},
					success: (res) => {
						console.log(res, '))))))))))))))))))))')
						this.newsInfo = res.data.data || null
					},
					fail: (error) => {

					}
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.scroll-view_H {
		width: 100%;

		.news-info {
			background-color: #fafafa;
			padding: 30rpx;
		}


	}
	
</style>